﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Transactions {
    import Engine.Transactions.*;
    import flash.net.*;
    import flash.external.*;

    public class TSendRollCallFacebookMessage extends Transaction {

        private var m_recipient:String;
        private var m_buildingId:int;
        private var m_userMessage:String;

        public function TSendRollCallFacebookMessage(_arg1:String, _arg2:int, _arg3:String){
            this.m_recipient = _arg1;
            this.m_buildingId = _arg2;
            this.m_userMessage = _arg3;
        }
        override public function perform():void{
            signedCall("UserService.createRollCallFacebookMessage", this.m_recipient, this.m_buildingId, this.m_userMessage);
        }
        override protected function onComplete(_arg1:Object):void{
            var url:* = null;
            var browser:* = null;
            var strippedUrl:* = null;
            var variables:* = null;
            var request:* = null;
            var result:* = _arg1;
            var useNavigateToURL:* = true;
            if (result["url"]){
                url = result["url"];
                try {
                    if (ExternalInterface.available){
                        browser = ExternalInterface.call("function a() {return navigator.userAgent;}");
                        if (((!((browser == null))) && ((browser.indexOf("Firefox") < 1)))){
                            useNavigateToURL = true;
                        } else {
                            ExternalInterface.call("console.log", "************** using window.open");
                            ExternalInterface.call("window.open", url, "_top", "");
                            useNavigateToURL = false;
                        };
                    };
                } catch(error:SecurityError) {
                    useNavigateToURL = true;
                };
                if (useNavigateToURL){
                    strippedUrl = result["strippedUrl"];
                    variables = result["urlParams"];
                    request = new URLRequest(strippedUrl);
                    request.data = variables;
                    try {
                        ExternalInterface.call("console.log", "*************** using navigateToURL");
                        navigateToURL(request, "_blank");
                    } catch(e:Error) {
                    };
                };
            };
        }

    }
}//package Transactions 
